local shanyao = fk.CreateSkill {
  name = "cf_shanyao",
}

Fk:loadTranslationTable {
  ["cf_shanyao"] = "闪耀",
  [":cf_shanyao"] = "若你已受伤，你可以将锦囊牌或装备牌当作【闪】或【桃】使用或打出。",
  ["#cf_shanyao"] = "你可以将锦囊牌或装备牌当作【闪】或【桃】使用或打出。",
  ["$cf_shanyao1"] = "打起精神来哦！",
  ["$cf_shanyao2"] = "放心交给我就好。",
}

shanyao:addEffect("viewas", {
  anim_type = "defensive",
  pattern = "peach,jink",
  interaction = function(self, player)
    local names = player:getViewAsCardNames(self.name, { "peach", "jink" })
    return UI.CardNameBox { choices = names, all_choices = { "peach", "jink" } }
  end,
  card_filter = function(self, player, to_select, selected, selected_targets)
    return player:hasSkill(self.name) and player:isWounded() and Fk:getCardById(to_select).type == Card.TypeTrick or
        Fk:getCardById(to_select).type == Card.TypeEquip and
        table.contains(player:getCardIds("he"), to_select)
  end,
  card_num = 1,
  include_equip = true,
  view_as = function(self, player, cards)
    if #cards ~= 1 or Fk.all_card_types[self.interaction.data] == nil then return end
    local card = Fk:cloneCard(self.interaction.data)
    card:addSubcard(cards[1])
    card.skillName = self.name
    return card
  end,
  enabled_at_play = function(self, player)
    return player:hasSkill(self.name) and player:isWounded()
  end,
  enabled_at_response = function(self, player, response)
    return player:hasSkill(self.name) and player:isWounded()
  end,
  prompt = "#" .. shanyao.name
})

return shanyao
